package com.qiuyuliantu.guide.service.impl;

import java.util.List;
import com.qiuyuliantu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qiuyuliantu.guide.mapper.GuideCookbookMethodMapper;
import com.qiuyuliantu.guide.domain.GuideCookbookMethod;
import com.qiuyuliantu.guide.service.IGuideCookbookMethodService;

/**
 * 美食菜谱教程Service业务层处理
 *
 * @author lmx
 * @date 2025-03-26
 */
@Service
public class GuideCookbookMethodServiceImpl implements IGuideCookbookMethodService
{
    @Autowired
    private GuideCookbookMethodMapper guideCookbookMethodMapper;

    /**
     * 查询美食菜谱教程
     *
     * @param id 美食菜谱教程主键
     * @return 美食菜谱教程
     */
    @Override
    public GuideCookbookMethod selectGuideCookbookMethodById(Long id)
    {
        return guideCookbookMethodMapper.selectGuideCookbookMethodById(id);
    }

    /**
     * 查询美食菜谱教程列表
     *
     * @param guideCookbookMethod 美食菜谱教程
     * @return 美食菜谱教程
     */
    @Override
    public List<GuideCookbookMethod> selectGuideCookbookMethodList(GuideCookbookMethod guideCookbookMethod)
    {
        return guideCookbookMethodMapper.selectGuideCookbookMethodList(guideCookbookMethod);
    }

    /**
     * 新增美食菜谱教程
     *
     * @param guideCookbookMethod 美食菜谱教程
     * @return 结果
     */
    @Override
    public int insertGuideCookbookMethod(GuideCookbookMethod guideCookbookMethod)
    {
        guideCookbookMethod.setCreateTime(DateUtils.getNowDate());
        return guideCookbookMethodMapper.insertGuideCookbookMethod(guideCookbookMethod);
    }

    /**
     * 修改美食菜谱教程
     *
     * @param guideCookbookMethod 美食菜谱教程
     * @return 结果
     */
    @Override
    public int updateGuideCookbookMethod(GuideCookbookMethod guideCookbookMethod)
    {
        guideCookbookMethod.setUpdateTime(DateUtils.getNowDate());
        return guideCookbookMethodMapper.updateGuideCookbookMethod(guideCookbookMethod);
    }

    /**
     * 批量删除美食菜谱教程
     *
     * @param ids 需要删除的美食菜谱教程主键
     * @return 结果
     */
    @Override
    public int deleteGuideCookbookMethodByIds(Long[] ids)
    {
        return guideCookbookMethodMapper.deleteGuideCookbookMethodByIds(ids);
    }

    /**
     * 删除美食菜谱教程信息
     *
     * @param id 美食菜谱教程主键
     * @return 结果
     */
    @Override
    public int deleteGuideCookbookMethodById(Long id)
    {
        return guideCookbookMethodMapper.deleteGuideCookbookMethodById(id);
    }
}
